<?php
	/**
	Deletes a template associated with this teacher.
	
	@author Michael Argarin
	@version Second Semester, AY 2010-2011
	*/
	include("../write_functions/write_functions.php");
	connect("localhost","root","","gradegriddatabase");
	
	// Delete template and all associated major and minor requirements
	$que = "DELETE minor.*, major.*, template.* FROM template LEFT OUTER JOIN major ON template.template_id = major.template_id LEFT OUTER JOIN minor ON major.major_id = minor.major_id WHERE template.template_id = '".$_GET['template_id']."'";
	$result = mysql_query($que);
	if(!$result){
		die('Error :' . mysql_error());
	}
	mysql_close();
	header("Location: accountSettingsC.php");
?>